#include<iostream>
using namespace std;
class Point3D
{
	int my_x, my_y, my_z;
public:
	Point3D(int x = 0, int y = 0, int z = 0)
	{
		my_x = x;
		my_y = y;
		my_z = z;
	}
	void SetPoint(int x = 0, int y = 0, int z = 0)
	{
		my_x = x;
		my_y = y;
		my_z = z;
	}
	friend ostream& operator<<(ostream& out, const Point3D& pt)

	{

		out << pt.my_x << "," << pt.my_y << "," << pt.my_z << endl;

		return out;

	}
	Point3D operator+(Point3D& p1)
	{
		Point3D t;
		t.my_x = my_x + p1.my_x;
		t.my_y = my_y + p1.my_y;
		t.my_z = my_z + p1.my_z;
		return t;
	}
	friend Point3D operator+(int x, Point3D& p1)
	{
		Point3D t;
		t.my_x = x + p1.my_x;
		t.my_y = p1.my_y;
		t.my_z =  p1.my_z;
		return t;
	}
};
int main()
{
	Point3D pt1, pt2, pt3, pt4;
	pt1.SetPoint(10, 20, 3);
	pt2.SetPoint(40, 50, 60);
	pt3 = pt1 + pt2;
	cout << "pt1:" << pt1;
	cout << "pt2:" << pt2;
	cout << "pt1+pt2:" << pt3;
	pt4 = 3 + pt1;
	cout << "3+pt1:" << pt4;
	return 0;

}